<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			html, body{
				height: 100%;
				overflow: hidden;
			}
			#canvas{
				position: absolute;
				left: 0;
				right: 0;
				top: 0;
				bottom: 0;
				margin: auto;
				background: pink;
				
			}
		</style>
		<script>
			// 同步思维, 有别于浏览器本身的渲染机制
			window.onload = function(){
				// 拿到画布
				var canvas = document.getElementById("canvas");
				
				if(canvas.getContext){
					var ctx = canvas.getContext("2d")
					
					// 填充的矩形
					ctx.fillStyle = "red"
					ctx.fillRect(0,0,100,100)
					
					// 带边框的矩形
					ctx.strokeStyle = "deepskyblue"
					ctx.lineWidth = 20
					ctx.lineJoin = "round"
					ctx.strokeRect(100,100,100,100)
					
					ctx.clearRect(100,100,100,100)
				}
			}
		</script>
	</head>
	<body>
		<canvas id="canvas" width="300px" height="300px">
			<span><a href="39.108.121.57:8080">您的浏览器不支持画布元素, 请您换成萌萌的chrome浏览器</a></span>
		</canvas>
	</body>
</html>
